package com.ex.phanso;

import java.io.FileReader;
import java.util.ArrayList;
import java.util.Scanner;

import com.ex.phanso.myinterface.IOItf;
import com.ex.phanso.myinterface.PhansoItf;

public class IOPhanso implements IOItf{

	@Override
	public ArrayList<PhansoItf> getPhanso() {
		
		ArrayList<PhansoItf>arr = new ArrayList<>();
		try {
			
			
			//b1
			Scanner reader = new Scanner(new FileReader("D:\\phanso.txt"));
			
			//
			while (reader.hasNextLine()) {
				String line = reader.nextLine();
				String[] s = line.split("\t");
				if (s.length == 2) {
					int tu = Integer.parseInt(s[0]);
					int mau = Integer.parseInt(s[1]);
					
					Phanso ps = new Phanso(tu, mau);
					
					//
					arr.add(ps);
				}
			}
			
			//b3
			reader.close();
		} catch (Exception e) {
			
		}
		
		
		
		return arr;
		
	}

}
